import config from "@/config"
import http from "@/utils/request"



export default {
  getAppVersionList: {
    url: `${config.API_URL}/version/list`,
    name: "获取app版本信息列表",
    get: function (data = {}) {
      return new Promise((resolve, reject) => {
        http.get(this.url, data).then((response) => {
          resolve(response)
        }).catch((error) => {
          resolve(error.data)
        })
      })
    }
  },
  addAppVersion: {
    url: `${config.API_URL}/version/add`,
    name: "添加app版本信息",
    post: function (data = {}) {
      return new Promise((resolve, reject) => {
        http.post(this.url, data).then((response) => {
          resolve(response)
        }).catch((error) => {
          resolve(error.data)
        })
      })
    }
  },
  updateAppVersion: {
    url: `${config.API_URL}/version/update`,
    name: "修改app版本信息",
    post: function (data = {}) {
      return new Promise((resolve, reject) => {
        http.post(this.url, data).then((response) => {
          resolve(response)
        }).catch((error) => {
          resolve(error.data)
        })
      })
    }
  },
  deleteAppVersion: {
    url: `${config.API_URL}/version/delete`,
    name: "删除app版本信息",
    post: function (data = {}) {
      return new Promise((resolve, reject) => {
        http.postParam(this.url, data).then((response) => {
          resolve(response)
        }).catch((error) => {
          resolve(error.data)
        })
      })
    }
  },
}
